Accessing variables inside static methods in Java